import React from "react";
import Square from "./Square";
import './Board.scss'

class Board extends React.Component {

    render() {
        return <div className="board-container">
            {this.props.squares.map((square, index) =>
                <Square value={square ? square.value : " "}
                        key={index}
                        active={square ? square.active : false}
                        handleClick={() => this.props.handleSquareClick(index)}
                />
            )}
        </div>
    }
}

export default Board
